HOSTCC = gcc
HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
-ifneq ($(debug),y)
-# Optimisation flags are overridable
-CFLAGS ?= -O3 -fomit-frame-pointer
-CFLAGS += -DNDEBUG
-else
-CFLAGS += -g
-endif
-
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
INSTALL_DATA = $(INSTALL) -m0644
INSTALL_PROG = $(INSTALL) -m0755
+ifneq ($(debug),y)
+# Optimisation flags are overridable
+CFLAGS ?= -O2 -fomit-frame-pointer
+CFLAGS += -DNDEBUG
+else
+CFLAGS += -g
+endif
+
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+CFLAGS += -m32 -march=i686
+endif
+
+ifeq ($(XEN_TARGET_ARCH),x86_64)
+CFLAGS += -m64
+endif
+
ifeq ($(XEN_TARGET_ARCH),x86_64)
LIBDIR = lib64
else
test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep -q " $(2) " && echo $(2))
-CFLAGS += -Wall
+CFLAGS += -Wall -Wstrict-prototypes
HOSTCFLAGS += $(call test-gcc-flag,$(HOSTCC),-Wdeclaration-after-statement)
CFLAGS += $(call test-gcc-flag,$(CC),-Wdeclaration-after-statement)
XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-CFLAGS += -m32 -march=i686
-LDFLAGS += -m32
-endif
-
-ifeq ($(XEN_TARGET_ARCH),x86_64)
-CFLAGS += -m64
-LDFLAGS += -m64
-endif
-
X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
%.opic: %.c
all: $(PROGS)
$(QEMU_USER): $(OBJS)
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
ifeq ($(ARCH),alpha)
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
# the address space (31 bit so sign extending doesn't matter)
endif
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
+ $(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
vnc.o: vnc.c keyboard_rdesktop.c
$(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
void tcx_init(DisplayState *ds, uint32_t addr);
/* sched.c */
-void sched_init();
+void sched_init(uint32_t, uint32_t);
/* magic-load.c */
void magic_init(const char *kfn, int kloadaddr, uint32_t addr);
int gdbserver_start(int port);
void update_select_wakeup_events(void);
-void tun_receive_handler();
+void tun_receive_handler(fd_set *);
extern char domain_name[];
#endif /* VL_H */
return fail;
}
-void usage()
+void usage(void)
{
fprintf(stderr, "You must specify at least -diskimage and -partition.\n");
fprintf(stderr, "All other arguments are passed through to 'mount'.\n");
DEPS = .*.d
mbootpack: $(OBJS)
- $(HOSTCC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
+ $(HOSTCC) -o $@ $(filter-out %.a, $^)
clean:
$(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
#include <errno.h>
#include <string.h>
-void usage()
+void usage(void)
{
printf("xc_shadow: -[0|1|2]\n");
printf(" set shadow mode\n");
int main(int argc, char *argv[])
{
int xc_handle;
- int mode;
+ int mode = 0;
if ( argc > 1 )
{
rm -f $(BIN) *~
$(BIN): $(OBJS)
- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
# libraries
LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
/**
* get_num_cpus - get the number of logical CPUs
*/
-unsigned int get_num_cpus()
+unsigned int get_num_cpus(void)
{
dom0_op_t op;
int xc_handle = xc_interface_open();
/**
* monitor_tbufs - monitor the contents of tbufs
*/
-int monitor_tbufs()
+int monitor_tbufs(void)
{
int i;
extern void process_record(int, struct t_rec *);
$(RANLIB) $@
$(SHLIB): $(OBJECTS)
- $(CC) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
src/xenstat.o: src/xenstat.c src/xenstat.h src/xen-interface.h
$(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
/* Initialize for xen-interface. Returns a handle to be used with subsequent
* calls to the xen-interface functions or NULL if an error occurs. */
-xi_handle *xi_init()
+xi_handle *xi_init(void)
{
xi_handle *handle;
/* Initialize for xen-interface. Returns a handle to be used with subsequent
* calls to the xen-interface functions or NULL if an error occurs. */
-xi_handle *xi_init();
+xi_handle *xi_init(void);
/* Release the handle to libxc, free resources, etc. */
void xi_uninit(xi_handle *handle);
/*
* libxenstat API
*/
-xenstat_handle *xenstat_init()
+xenstat_handle *xenstat_init(void)
{
xenstat_handle *handle;
/* Initialize the xenstat library. Returns a handle to be used with
* subsequent calls to the xenstat library, or NULL if an error occurs. */
-xenstat_handle *xenstat_init();
+xenstat_handle *xenstat_init(void);
/* Release the handle to libxc, free resources, etc. */
void xenstat_uninit(xenstat_handle * handle);
static TDB_CONTEXT *tdb_ctx;
static void corrupt(struct connection *conn, const char *fmt, ...);
-static void check_store();
+static void check_store(void);
#define log(...) \
do { \
}
-static void reopen_log()
+static void reopen_log(void)
{
if (tracefile) {
if (tracefd > 0)
}
-static void check_store()
+static void check_store(void)
{
char * root = talloc_strdup(NULL, "/");
struct hashtable * reachable =
/**
* get_num_cpus - get the number of logical CPUs
*/
-unsigned int get_num_cpus()
+unsigned int get_num_cpus(void)
{
dom0_op_t op;
int xc_handle = xc_interface_open();
CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector)
CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
-ifeq ($(TARGET_SUBARCH),x86_32)
-CFLAGS += -m32 -march=i686
-LDFLAGS += -m elf_i386
-ifeq ($(pae),y)
+ifeq ($(TARGET_SUBARCH)$(pae),x86_32y)
CFLAGS += -DCONFIG_X86_PAE=1
endif
-endif
+
ifeq ($(supervisor_mode_kernel),y)
CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1
endif
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+LDFLAGS += -m elf_i386
+endif
+
ifeq ($(TARGET_SUBARCH),x86_64)
-CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
+CFLAGS += -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
LDFLAGS += -m elf_x86_64
endif
unmap_domain_page(pt);
}
- void adjust_shadow_tables()
+ void adjust_shadow_tables(void)
{
struct shadow_status *a;
unsigned long smfn, gmfn;
}
}
- void adjust_oos_list()
+ void adjust_oos_list(void)
{
struct out_of_sync_entry *oos;
}
}
- void adjust_for_pgtbase()
+ void adjust_for_pgtbase(void)
{
struct vcpu *v;
}
}
- void adjust_guest_pages()
+ void adjust_guest_pages(void)
{
struct list_head *list_ent = d->page_list.next;
struct page_info *page;
}
}
-void pic_irq_request(int *interrupt_request, int level)
+void pic_irq_request(void *data, int level)
{
- if (level)
- *interrupt_request = 1;
- else
- *interrupt_request = 0;
+ int *interrupt_request = data;
+ *interrupt_request = level;
}
void hvm_pic_assist(struct vcpu *v)
pic_reset(s);
}
-void pic_init(struct hvm_virpic *s, void (*irq_request)(),
+void pic_init(struct hvm_virpic *s, void (*irq_request)(void *, int),
void *irq_request_opaque)
{
memset(s, 0, sizeof(*s));
return;
}
-void pic_set_alt_irq_func(struct hvm_virpic *s, void (*alt_irq_func)(),
+void pic_set_alt_irq_func(struct hvm_virpic *s,
+ void (*alt_irq_func)(void *, int, int),
void *alt_irq_opaque)
{
s->alt_irq_func = alt_irq_func;
return error;
}
-static inline int construct_vmcs_host()
+static inline int construct_vmcs_host(void)
{
int error = 0;
#ifdef __x86_64__
void do_nmi(struct cpu_user_regs *);
-static int check_vmx_controls(ctrls, msr)
+static int check_vmx_controls(u32 ctrls, u32 msr)
{
u32 vmx_msr_low, vmx_msr_high;
rdmsr(msr, vmx_msr_low, vmx_msr_high);
- if (ctrls < vmx_msr_low || ctrls > vmx_msr_high) {
+ if ( (ctrls < vmx_msr_low) || (ctrls > vmx_msr_high) )
+ {
printk("Insufficient VMX capability 0x%x, "
"msr=0x%x,low=0x%8x,high=0x%x\n",
ctrls, msr, vmx_msr_low, vmx_msr_high);
* leading zeros).
*/
u64
-__qdivrem(uq, vq, arq)
- u64 uq, vq, *arq;
+__qdivrem(u64 uq, u64 vq, u64 *arq)
{
union uu tmp;
digit *u, *v, *q;
* Divide two unsigned quads.
*/
u64
-__udivdi3(a, b)
- u64 a, b;
+__udivdi3(u64 a, u64 b)
{
return (__qdivrem(a, b, (u64 *)0));
extern void hvm_wait_io(void);
extern void hvm_safe_block(void);
extern void hvm_io_assist(struct vcpu *v);
-extern void pic_irq_request(int *interrupt_request, int level);
+extern void pic_irq_request(void *data, int level);
extern void hvm_pic_assist(struct vcpu *v);
extern int cpu_get_interrupt(struct vcpu *v, int *type);
extern int cpu_has_pending_irq(struct vcpu *v);
/* 0 is master pic, 1 is slave pic */
/* XXX: better separation between the two pics */
PicState pics[2];
- void (*irq_request)(int *opaque, int level);
+ void (*irq_request)(void *opaque, int level);
void *irq_request_opaque;
/* IOAPIC callback support */
void (*alt_irq_func)(void *opaque, int irq_num, int level);
void pic_set_irq(struct hvm_virpic *s, int irq, int level);
void pic_set_irq_new(void *opaque, int irq, int level);
void pic_init(struct hvm_virpic *s,
- void (*irq_request)(),
+ void (*irq_request)(void *, int),
void *irq_request_opaque);
void pic_set_alt_irq_func(struct hvm_virpic *s,
- void(*alt_irq_func)(),
+ void (*alt_irq_func)(void *, int, int),
void *alt_irq_opaque);
int pic_read_irq(struct hvm_virpic *s);
void pic_update_irq(struct hvm_virpic *s);
void sched_rem_domain(struct vcpu *);
long sched_ctl(struct sched_ctl_cmd *);
long sched_adjdom(struct sched_adjdom_cmd *);
-int sched_id();
+int sched_id(void);
void vcpu_wake(struct vcpu *d);
void vcpu_sleep_nosync(struct vcpu *d);
void vcpu_sleep_sync(struct vcpu *d);